Misc bugfix