Have found the cause of the problem, or rather have found a cure, still not sure what the problem is.

In micro code studio uncheck "Microchip MPASM" in the assembler options window.

Not sure whats assembling the code now but it works...