Fixed a few bugs/still in debug mode