Fixed minor bugs and added pedantic flag for configuration verification
minor bug fixes
Refactor and minor bug fixes from previous refactor
import err