Fixed bug and other stuff