Little bug fixes and useful scripts