Added error handling to module import.