fixed @media case + error handling; core grammar tweaks