Fixed all outstanding bugs