I corrected some errors like this on for myself. It's a "works for me version" but if someone likes to use it it's on github. https://github.com/schiffsratte/Porthole