fixed a problem with parameter annotations. This should be revisited at some point to see whether it can be done more efficiently.