various bugs removed