Bug fixes, refactoring

Fix for the crypter function and interrupt handler