Small bug fixes and added in the written tutorial.