Tidied up exception catching
Fixed imports
Fixed line wrap in docs