Fixes to listening
Fixed regression that caused directives to not be removed from static files