Minimal fixes for the code