Add changes suggestted by mossmann