Patches done in conjunction with Juan Zamorano Flores <jzamora@…>. He debugged enough to let me know what was wrong and I supplied the code. :)