Improve fixes for #1317
Fixes Atmosphere/nettosphere#50