Re-factored some imports using six
Fix exception catching and keyword arguments