Fixing pointer error that was causing problems.

Also added more try/catch blocks for improved error handling while the best H matrix candidate is being found.