marmalade-add-packages: fixes and tests for the case where there are packages