minor bug fixes/Test fixes