Improved license detection