Additons and bug fixes