Extensive bugfix
Prototype compile ready
Prototype compile ready