Bug fixes: Catch exceptions