Fix inactive time handling