Bug fixed. Ready to start with tests.