Small bugfixes resulting from all day testing