Fix for item #1133

This fixes:
http://ae-mod.info/Tracker/1133/
Where is 74e4e50c76e812cc227bea020f3c8646eacfedb1 I don't see it in the API branch, I assume you need to PR that as well?