Fixing some minior issues needs testing