Lot of Bug fixes