Bug & performance fixes