Merged the changes from the lighting branch. Fixes #3.