Added more error checking. Forgot to remove boost debug options from previous testing.