Added a debug folder and fixed known bugs