Fixed NPE and updated missing patches