Removed compilation warnings about wrong state prototypes. Code formatting.