Fixed args order and added/changed some logging