Fixed bugs in BS and BSWF