Move normalization of extent into function.
Misc CRAN check fixes.