Fixed promote and demote - Fixes #249