Changed report code. Bug fixes