Fixes for github issues