Credentials fixes

Bug fixes as reported by mysurk for issue 5 and 6