Bug fixes take2