Improve Megastek decoder (fix #525)