Pull in BluBaron's fixes from last December before they go out of date.

Fix a Windows crash, fix case ('false'/'true' -> 'FALSE'/'TRUE'), make prt_map more efficient and cleaner.