Added multi-user support and fixed bugs

Added multi-user support and fixed bugs