Misc changes applied. Fixed lots of bugs. Improved functionality.