misc fixes from SensioLabs Insight