Fixed bugs, added tests and ready for alpha