Fixed some errors and updated with upstream