Fix for some bugs and AS behavior