Added better error checking, removed debug symbols.