ensuring valid keys for dictionaries via static asserts, line length cleanup, portability fixes