Fixed problems and improved functionality