Minor bugs here and there... now reasonable working