Bugfix by "Chiu Wai Pun" <pun@alumni.ust.hk>