Known bugs fixed. + refactoring.