Fixed bugs, added functionality, added MySQL test