Fixed bug with window not returning if configured to minimize upon record/playback
Basic improvements to key record/playback code