Fix misc bugs when not using int keys