Added 'Debug' target, fixed some issues