Fixed prototypes written in 2010. Needs a bit fixing and testing...