Some improvements / fixes to cfg library.