Fix warnings in directive code