Replace assertions with logging
Improve postgis conversions #631