Code conventions. Minor bugfixing