Fixing directives to correctly handle various states