Somes bugfixes