Fix for #307
Merge pull request #317 from dotcloud/307-loginfix

Fix for #307