Bug fixes. Added mainpage to documentation.