Fixed license bug and bat encoding bug