Even more bug fixing