Fixes #44, also fixed some broken references