Clean up and improve meter detection