Merge: fix some errors, more to come