Bugfix and implement indexes

2 from another branch plus my one liner synthesis warning fix.