Merged from github version