Fixed: various bugs