Implemented suggested corrections from Thomas