Promises/A+ compliance (fixes #2)