Fix pressing enter having no effect

This commit adds back all my previous changes that were inadvertently removed by 857c260 (mostly formatting)