Code cleanup

Did a reset if the init fails. Added TODOs