Bugfixes. Little improvements